package com.code.cheney.shiro.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**   
 *    
 * Project: shiro   
 * Class: CenterController   
 * Description: 
 * @author: Cheney   
 * @Date 2016年7月3日 下午6:01:53
 * @version 1.0
 *    
 */
@Controller
public class CenterController {
	@RequestMapping("/hello1")
    public String hello1() {
        SecurityUtils.getSubject().checkRole("admin");
        return "success";
    }

    @RequiresRoles("admin")
    @RequestMapping("/hello2")
    public String hello2() {
        return "success";
    }
}
